From e377eb43033500de815eb46e5355fd4a67d769d8 Mon Sep 17 00:00:00 2001 From: Alex Z Date: Sat, 21 Feb 2009 07:38:57 +0000 Subject: [PATCH] (bug 13778) - Add a hidden input to the search form so that using the enter key on IE does a fulltext search like clicking the button does. --- RELEASE-NOTES | 2 ++ includes/specials/SpecialSearch.php | 11 ++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 51b49f5bd8..f6c9175d80 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -207,6 +207,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN changed to rc_timestamp_bot * (bug 17437) Fixed incorrect link to web-based installer * (bug 17538) Use shorter URLs in elements +* (bug 13778) Hidden input added to the search form so that using the Enter key + on IE will do a fulltext search like clicking the button does == API changes in 1.15 == * (bug 16858) Revamped list=deletedrevs to make listing deleted contributions diff --git a/includes/specials/SpecialSearch.php b/includes/specials/SpecialSearch.php index e13a53a8ad..fc14b6a50d 100644 --- a/includes/specials/SpecialSearch.php +++ b/includes/specials/SpecialSearch.php @@ -634,6 +634,7 @@ class SpecialSearch { " " . $searchField . " " . + Xml::hidden( 'fulltext', 'Advanced search' ) . "\n" . $searchButton . "". ""; @@ -765,6 +766,7 @@ class SpecialSearch { $out .= Xml::hidden( "redirs", (int)$this->searchRedirects ); // Term box $out .= Xml::input( 'search', 50, $term, array( 'type' => 'text', 'id' => 'searchText' ) ) . "\n"; + $out .= Xml::hidden( 'fulltext', 'Search' ); $out .= Xml::submitButton( wfMsg( 'searchbutton' ), array( 'name' => 'fulltext' ) ); $out .= ' (' . wfMsgExt('searchmenu-help',array('parseinline') ) . ')'; $out .= Xml::closeElement( 'form' ); @@ -1430,10 +1432,11 @@ class SpecialSearchOld { $searchField = Xml::input( 'search', 50, $term, array( 'type' => 'text', 'id' => 'powerSearchText' ) ); $searchButton = Xml::submitButton( wfMsg( 'powersearch' ), array( 'name' => 'fulltext' ) ) . "\n"; $searchTitle = SpecialPage::getTitleFor( 'Search' ); + $searchHiddens = Xml::hidden( 'title', $searchTitle->getPrefixedText() ) . "\n"; + $searchHiddens .= Xml::hidden( 'fulltext', 'Advanced search' ) . "\n"; $out = Xml::openElement( 'form', array( 'id' => 'powersearch', 'method' => 'get', 'action' => $wgScript ) ) . - Xml::fieldset( wfMsg( 'powersearch-legend' ), - Xml::hidden( 'title', $searchTitle->getPrefixedText() ) . "\n" . + Xml::fieldset( wfMsg( 'powersearch-legend' ), "

" . wfMsgExt( 'powersearch-ns', array( 'parseinline' ) ) . "

\n" . @@ -1446,6 +1449,7 @@ class SpecialSearchOld { " " . $searchField . " " . + $searchHiddens . $searchButton ) . ""; @@ -1470,13 +1474,14 @@ class SpecialSearchOld { 'action' => $wgScript )); $searchTitle = SpecialPage::getTitleFor( 'Search' ); - $out .= Xml::hidden( 'title', $searchTitle->getPrefixedText() ); $out .= Xml::input( 'search', 50, $term, array( 'type' => 'text', 'id' => 'searchText' ) ) . ' '; foreach( SearchEngine::searchableNamespaces() as $ns => $name ) { if( in_array( $ns, $this->namespaces ) ) { $out .= Xml::hidden( "ns{$ns}", '1' ); } } + $out .= Xml::hidden( 'title', $searchTitle->getPrefixedText() ); + $out .= Xml::hidden( 'fulltext', 'Search' ); $out .= Xml::submitButton( wfMsg( 'searchbutton' ), array( 'name' => 'fulltext' ) ); $out .= Xml::closeElement( 'form' ); -- 2.20.1